/**   
 * 价格保留n小数,默认保留两位
 *  var currency = require("mlib/util/currency");
 *  console.log(currency(9.9999,2));
 */

	
module.exports = function(number, precision){
    if(typeof(precision)=="undefined") {
		precision = 2;
	}
	var factor = Math.pow(10, precision);
	var tempNumber = number * factor;
	var roundedTempNumber = Math.round(tempNumber);
	return roundedTempNumber / factor;	
};